#!/bin/bash

TempE=`/usr/sbin/ssacli ctrl slot=0 show config |grep -E "box"|awk -F "[()]" '{print $2}'|sed -e '/OK/d'` # 提取所有的驱动盘行，再找不是OK的行
if [ "t$TempE" == "t" ];then
        #没有不是OK的行，都是OK
        echo "all disk are OK"
        exit 0
else
        ErrString=`/usr/sbin/ssacli ctrl slot=0 show config |grep -E "box"|awk -F "[()]" '{print $2}'|sed -e '/OK/d'|awk -F ',' '{print $1 "|"}' |awk BEGIN{RS=EOF}'{gsub(/\n/," ");print}'` #提出不是OK行的位置信息
        echo "physicaldrive is Err: $ErrString "

fi

